package HeSuanServer.controller;

import HeSuanServer.POJO.R.Result;
import HeSuanServer.POJO.User;
import HeSuanServer.service.UserCliService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @描述:
 * @author: LH
 * @date: 2023/3/14
 */
@RestController
@CrossOrigin
@RequestMapping("usercli")
@Slf4j
public class UserCliController {
    @Autowired
    private UserCliService service;
    @PostMapping("register")
    public Result register(@RequestBody User user){
        return service.register(user);
    }
    @PostMapping("login")
    public Result login(@RequestBody  User user){
        return service.login(user);
    }
    @GetMapping("wj")
    public Result wj(String number){
        return service.wj(number);
    }
    @GetMapping("verify")
    public Result verify(String number, String code){
        return service.verify(number,code);
    }
    @PostMapping("setpassword")
    public Result setPassword(Integer id, String password){
        return service.setPassword(id,password);
    }
    @GetMapping("getData")
    public Result getData(Integer id){
        return service.getData(id);
    }
    @GetMapping("getUser")
    public Result getUser(Integer id){
        return service.getUser(id);
    }
    @PostMapping("setUser")
    public Result setUser(@RequestBody  User user){
        return service.setUser(user);
    }
}
